package com.shine.icis.hbean;

import java.io.Serializable;

import com.shine.icis.config.SysCodeDictLoader;
import com.shine.icis.util.Tools;


public class MetadataCheckLog implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 2415088348566987884L;
	
	private	Long logID;  //日志ID
	private Integer etlProcID;  //ETL过程ID
	private Integer prepLevelID; //预警级别ID
	private Integer operDate;  //操作日期（年、月、日）
	private Integer operTime;  //操作时间（时、分、秒）
	private Character runStatus; //检查状态（1：通过，0：未通过）
	private String resultMsg;   //结果信息
	
	private MetadataCheckItem metadataCheckItem;
	public Long getLogID() {
		return logID;
	}
	public void setLogID(Long logID) {
		this.logID = logID;
	}
	public Integer getEtlProcID() {
		return etlProcID;
	}
	public void setEtlProcID(Integer etlProcID) {
		this.etlProcID = etlProcID;
	}
	public Integer getPrepLevelID() {
		return prepLevelID;
	}
	public void setPrepLevelID(Integer prepLevelID) {
		this.prepLevelID = prepLevelID;
	}
	public Integer getOperDate() {
		return operDate;
	}
	public void setOperDate(Integer operDate) {
		this.operDate = operDate;
	}

	public Integer getOperTime() {
		return operTime;
	}
	public void setOperTime(Integer operTime) {
		this.operTime = operTime;
	}
	public Character getRunStatus() {
		return runStatus;
	}
	public void setRunStatus(Character runStatus) {
		this.runStatus = runStatus;
	}
	public String getResultMsg() {
		return resultMsg;
	}
	public void setResultMsg(String resultMsg) {
		this.resultMsg = resultMsg;
	}
	public MetadataCheckItem getMetadataCheckItem() {
		return metadataCheckItem;
	}
	public void setMetadataCheckItem(MetadataCheckItem metadataCheckItem) {
		this.metadataCheckItem = metadataCheckItem;
	}
	public String getFormatOperDate() {
		StringBuffer sb = new StringBuffer();
		sb.append(operDate);
		if (sb.length() != 8) {
			return "";
		}
		return sb.insert(6, "-").insert(4, "-").toString();
	}
	
	public String getFormatOperTime() {
		StringBuffer sb = new StringBuffer();
		sb.append(Tools.getFixedNum(operTime, 6));
		return sb.insert(4, ":").insert(2, ":").toString();
	}	
	public String getPrepLevelText() {
		if (prepLevelID == null) {
			return "";
		}
 		return SysCodeDictLoader.getInstance().getPrepLevelOptionText(prepLevelID.toString());
	}
	
	public String getItemName(){
		return metadataCheckItem.getItemName();
	}
	
	public String getRunStatusText(){
		if(runStatus == '1'){
			return "通过";
		}else{
			return "未通过";
		}
	}
}
